Optimal. Leaf size=111 \[ a^2 \sin (c) \text{CosIntegral}(d x)+a^2 \cos (c) \text{Si}(d x)+\frac{2 a b \sin (c+d x)}{d^2}-\frac{2 a b x \cos (c+d x)}{d}+\frac{3 b^2 x^2 \sin (c+d x)}{d^2}-\frac{6 b^2 \sin (c+d x)}{d^4}+\frac{6 b^2 x \cos (c+d x)}{d^3}-\frac{b^2 x^3 \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.172497, antiderivative size = 111, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 6, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.316, Rules used = {3339, 3303, 3299, 3302, 3296, 2637} \[ a^2 \sin (c) \text{CosIntegral}(d x)+a^2 \cos (c) \text{Si}(d x)+\frac{2 a b \sin (c+d x)}{d^2}-\frac{2 a b x \cos (c+d x)}{d}+\frac{3 b^2 x^2 \sin (c+d x)}{d^2}-\frac{6 b^2 \sin (c+d x)}{d^4}+\frac{6 b^2 x \cos (c+d x)}{d^3}-\frac{b^2 x^3 \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3339
Rule 3303
Rule 3299
Rule 3302
Rule 3296
Rule 2637
Rubi steps
\begin{align*} \int \frac{\left (a+b x^2\right )^2 \sin (c+d x)}{x} \, dx &=\int \left (\frac{a^2 \sin (c+d x)}{x}+2 a b x \sin (c+d x)+b^2 x^3 \sin (c+d x)\right ) \, dx\\ &=a^2 \int \frac{\sin (c+d x)}{x} \, dx+(2 a b) \int x \sin (c+d x) \, dx+b^2 \int x^3 \sin (c+d x) \, dx\\ &=-\frac{2 a b x \cos (c+d x)}{d}-\frac{b^2 x^3 \cos (c+d x)}{d}+\frac{(2 a b) \int \cos (c+d x) \, dx}{d}+\frac{\left (3 b^2\right ) \int x^2 \cos (c+d x) \, dx}{d}+\left (a^2 \cos (c)\right ) \int \frac{\sin (d x)}{x} \, dx+\left (a^2 \sin (c)\right ) \int \frac{\cos (d x)}{x} \, dx\\ &=-\frac{2 a b x \cos (c+d x)}{d}-\frac{b^2 x^3 \cos (c+d x)}{d}+a^2 \text{Ci}(d x) \sin (c)+\frac{2 a b \sin (c+d x)}{d^2}+\frac{3 b^2 x^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text{Si}(d x)-\frac{\left (6 b^2\right ) \int x \sin (c+d x) \, dx}{d^2}\\ &=\frac{6 b^2 x \cos (c+d x)}{d^3}-\frac{2 a b x \cos (c+d x)}{d}-\frac{b^2 x^3 \cos (c+d x)}{d}+a^2 \text{Ci}(d x) \sin (c)+\frac{2 a b \sin (c+d x)}{d^2}+\frac{3 b^2 x^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text{Si}(d x)-\frac{\left (6 b^2\right ) \int \cos (c+d x) \, dx}{d^3}\\ &=\frac{6 b^2 x \cos (c+d x)}{d^3}-\frac{2 a b x \cos (c+d x)}{d}-\frac{b^2 x^3 \cos (c+d x)}{d}+a^2 \text{Ci}(d x) \sin (c)-\frac{6 b^2 \sin (c+d x)}{d^4}+\frac{2 a b \sin (c+d x)}{d^2}+\frac{3 b^2 x^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text{Si}(d x)\\ \end{align*}
Mathematica [A] time = 0.405119, size = 82, normalized size = 0.74 \[ a^2 \sin (c) \text{CosIntegral}(d x)+a^2 \cos (c) \text{Si}(d x)+\frac{b \left (2 a d^2+3 b \left (d^2 x^2-2\right )\right ) \sin (c+d x)}{d^4}-\frac{b x \left (2 a d^2+b \left (d^2 x^2-6\right )\right ) \cos (c+d x)}{d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.013, size = 236, normalized size = 2.1 \begin{align*}{\frac{ \left ({c}^{3}+{c}^{2}+c+1 \right ){b}^{2} \left ( - \left ( dx+c \right ) ^{3}\cos \left ( dx+c \right ) +3\, \left ( dx+c \right ) ^{2}\sin \left ( dx+c \right ) -6\,\sin \left ( dx+c \right ) +6\, \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{{d}^{4}}}-4\,{\frac{c{b}^{2} \left ({c}^{2}+c+1 \right ) \left ( - \left ( dx+c \right ) ^{2}\cos \left ( dx+c \right ) +2\,\cos \left ( dx+c \right ) +2\, \left ( dx+c \right ) \sin \left ( dx+c \right ) \right ) }{{d}^{4}}}+2\,{\frac{ \left ( 1+c \right ) ab \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{{d}^{2}}}+6\,{\frac{ \left ( 1+c \right ){c}^{2}{b}^{2} \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{{d}^{4}}}+4\,{\frac{cab\cos \left ( dx+c \right ) }{{d}^{2}}}+4\,{\frac{{c}^{3}{b}^{2}\cos \left ( dx+c \right ) }{{d}^{4}}}+{a}^{2} \left ({\it Si} \left ( dx \right ) \cos \left ( c \right ) +{\it Ci} \left ( dx \right ) \sin \left ( c \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] time = 7.84013, size = 157, normalized size = 1.41 \begin{align*} \frac{{\left (a^{2}{\left (-i \,{\rm Ei}\left (i \, d x\right ) + i \,{\rm Ei}\left (-i \, d x\right )\right )} \cos \left (c\right ) + a^{2}{\left ({\rm Ei}\left (i \, d x\right ) +{\rm Ei}\left (-i \, d x\right )\right )} \sin \left (c\right )\right )} d^{4} - 2 \,{\left (b^{2} d^{3} x^{3} + 2 \,{\left (a b d^{3} - 3 \, b^{2} d\right )} x\right )} \cos \left (d x + c\right ) + 2 \,{\left (3 \, b^{2} d^{2} x^{2} + 2 \, a b d^{2} - 6 \, b^{2}\right )} \sin \left (d x + c\right )}{2 \, d^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.67114, size = 300, normalized size = 2.7 \begin{align*} \frac{2 \, a^{2} d^{4} \cos \left (c\right ) \operatorname{Si}\left (d x\right ) - 2 \,{\left (b^{2} d^{3} x^{3} + 2 \,{\left (a b d^{3} - 3 \, b^{2} d\right )} x\right )} \cos \left (d x + c\right ) + 2 \,{\left (3 \, b^{2} d^{2} x^{2} + 2 \, a b d^{2} - 6 \, b^{2}\right )} \sin \left (d x + c\right ) +{\left (a^{2} d^{4} \operatorname{Ci}\left (d x\right ) + a^{2} d^{4} \operatorname{Ci}\left (-d x\right )\right )} \sin \left (c\right )}{2 \, d^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 6.39307, size = 160, normalized size = 1.44 \begin{align*} a^{2} \sin{\left (c \right )} \operatorname{Ci}{\left (d x \right )} + a^{2} \cos{\left (c \right )} \operatorname{Si}{\left (d x \right )} + 2 a b x \left (\begin{cases} - \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\cos{\left (c + d x \right )}}{d} & \text{otherwise} \end{cases}\right ) - 2 a b \left (\begin{cases} - x \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\begin{cases} \frac{\sin{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \cos{\left (c \right )} & \text{otherwise} \end{cases}}{d} & \text{otherwise} \end{cases}\right ) + b^{2} x^{3} \left (\begin{cases} - \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\cos{\left (c + d x \right )}}{d} & \text{otherwise} \end{cases}\right ) - 3 b^{2} \left (\begin{cases} - \frac{x^{3} \cos{\left (c \right )}}{3} & \text{for}\: d = 0 \\- \frac{\begin{cases} \frac{x^{2} \sin{\left (c + d x \right )}}{d} + \frac{2 x \cos{\left (c + d x \right )}}{d^{2}} - \frac{2 \sin{\left (c + d x \right )}}{d^{3}} & \text{for}\: d \neq 0 \\\frac{x^{3} \cos{\left (c \right )}}{3} & \text{otherwise} \end{cases}}{d} & \text{otherwise} \end{cases}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]